x86/traps: Poison unused stack pointers in the TSS
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Apr 2017 14:39:08 +0000 (15:39 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 May 2017 08:54:28 +0000 (09:54 +0100)
commit040e1457c109185a5420e24203cad8e92f3caaca
tree738381c4ec61fff1e1f8ecc096b1d8d3c529f6bb
parent98dffb05ce48097ecf82bcadc9ae8acb3818a610
x86/traps: Poison unused stack pointers in the TSS

This is for additional defence-in-depth following LDT/GDT/IDT corruption.

It causes attempted control transfers to ring 1 or 2 (via a call gate), or
attempts to use IST 3 through 7 to yield #SS, rather than executing with a
stack starting at the top of virtual address space.

Express the TSS setup in terms of structure assignment, which should be less
fragile if the IST indexes need to change, and has the useful side effect of
zeroing the reserved fields.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/x86/cpu/common.c